import Vue from 'vue'
import store from './store'
import App from './App'
import cuCustom from './components/cu-custom.vue'
import iconfont from './components/iconfont/iconfont.vue'
import iGlobal from './common/global.js'	//引入 global.js
import tabBar from './components/tabbar.vue' 
import painter from './components/painter/index.vue' 

import router from './router'
import { RouterMount } from 'uni-simple-router'
import tui from './common/httpRequest'
// #ifdef H5
window.QQmap = null;
// #endif
// #ifndef MP-TOUTIAO
//网络监听
setTimeout(() => {
	uni.onNetworkStatusChange(function(res) {
		//console.log(res.networkType);
		store.commit("networkChange", {
			isConnected: res.isConnected
		})
	});
}, 100)
// #endif
Vue.prototype.tui = tui
Vue.prototype.$eventHub = Vue.prototype.$eventHub || new Vue()
Vue.prototype.$store = store

Vue.component('painter', painter)
Vue.component('tab-bar', tabBar)
Vue.component('cu-custom',cuCustom) //全局导航组件
Vue.component('iconfont',iconfont) //全局图标组件
Vue.prototype.iGlobal=iGlobal	//将global.js挂载至Vue.prototype 实现全局调用
Vue.prototype.$store = store
Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
	store,
    ...App
})

//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5
	RouterMount(app,'#app');
// #endif

// #ifndef H5
	app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif